package com.lincoln.entity.client;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.lincoln.entity.base.BaseEntity;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;

@Data
@Entity(name="oauth_client_details")
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })//转json忽略参数
public class DbClient extends BaseEntity{
    @Column(name = "client_id",columnDefinition = "varchar(256)",length = 256)
    String clientId;
    @Column(name = "resource_ids",columnDefinition = "varchar(256)",length = 256)
    String resourceIds;
    @Column(name = "client_secret",columnDefinition = "varchar(256)",length = 256)
    String clientSecret;
    @Column(name = "scope",columnDefinition = "varchar(256)",length = 256)
    String scope;
    @Column(name = "authorized_grant_types",columnDefinition = "varchar(256)",length = 256)
    String authorizedGrantTypes;
    @Column(name = "web_server_redirect_uri",columnDefinition = "varchar(256)",length = 256)
    String webServerRedirectUri;
    @Column(name = "authorities",columnDefinition = "varchar(256)",length = 256)
    String authorities;
    @Column(name = "access_token_validity",columnDefinition = "int(11)",length = 11)
    Integer accessTokenValidity;
    @Column(name = "refresh_token_validity",columnDefinition = "int(11)",length = 11)
    Integer refreshTokenValidity;
    @Column(name = "additional_information",columnDefinition = "varchar(4096)",length = 4096)
    String additionalInformation;
    @Column(name = "autoapprove",columnDefinition = "varchar(256)",length = 256)
    String autoapprove;
    /** spring官方给出的客户端表结构
     client_id VARCHAR(256) PRIMARY KEY,
     resource_ids VARCHAR(256),
     client_secret VARCHAR(256),
     scope VARCHAR(256),
     authorized_grant_types VARCHAR(256),
     web_server_redirect_uri VARCHAR(256),
     authorities VARCHAR(256),
     access_token_validity INTEGER,
     refresh_token_validity INTEGER,
     additional_information VARCHAR(4096),
     autoapprove VARCHAR(256)
     */
}
